package com.lizhi.yun.db.stand.pojo;/**
 * @program: sfrobot-html
 * @name StandAppointPOJO
 * @description:
 * @author: lizhi
 * @create: 2020-05-26 17:22
 */

import com.lizhi.mybatis.boot.Description;
import lombok.Data;
import lombok.ToString;

import javax.persistence.*;

/**
 *@program: sfrobot-html
 *@name StandAppointPOJO
 *@description: 康复预约
 *@author: lizhi
 *@create: 2020-05-26 17:22
 */
@Data
@ToString
@Entity
@Table(name = "stand_appoint_info")
@Description("康复预约")
public class StandAppointPOJO {

    @Id
    @Column(length = 30)
    @Description("lid")
    public String lid;

    @Column(length = 30)
    @Description("预约id")
    private String appointId;

    @Column(length = 30)
    @Description("患者id")
    private String appointPtId;

    @Column(length = 300)
    @Description("患者姓名")
    private String appointPtNm;

    @Column(length = 11)
    @Description("患者手机号")
    private String appointPtPhone;

    @Column(length = 30)
    @Description("处方id")
    private String appointPreId;

    @Column(length = 300)
    @Description("机器人编号")
    private String appointCode;

    @Column(length = 19)
    @Description("开始时间")
    private String appointStartTm;

    @Column(length = 19)
    @Description("结束时间")
    private String appointEndTm;

    @Column(length = 30)
    @Description("时长(分钟)")
    private String appointDuration;

    @Column(length = 500)
    @Description("创建者")
    private String appointCrtBy;

    @Column(length = 500)
    @Description("更新者")
    private String appointUpdBy;

    @Column(length = 19)
    @Description("插入时间")
    private String appointInsertTm;

    @Column(length = 19)
    @Description("修改时间")
    private String appointUpdateTm;

    @Column(length = 2)
    @Description("预约状态00-已预约，01-已使用,02-取消预约")
    private String appointStatus;

    @Transient
    @Description("预约状态")
    private String appointStatusText;

    @Column(length = 2)
    @Description("上传云管的状态(00-未上传，01-已上传)")
    private String appointUpState;

    @Column(length = 19)
    @Description("患者信息上传到云管的时间")
    private String appointUpTm;

    @Column(length = 500)
    @Description("患者主治医生")
    private String ptDoctor;

    /*云管需要的数据*/
    @Column(length = 200)
    @Description("医院ID")
    private String hospitalId;

    @Column(length = 200)
    @Description("系统ID")
    private String hospitalSystemId;

    public String getAppointStatusText() {
        if ("00".equals(this.appointStatus)){
            this.appointStatusText = "已预约";
        } else if ("01".equals(this.appointStatus)){
            this.appointStatusText = "已使用";
        } else if ("02".equals(this.appointStatus)){
            this.appointStatusText = "取消预约";
        }
        return appointStatusText;
    }
}
